#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
using namespace std;

int main() {
    string str;
    while (getline(cin, str)) {
        size_t pos = str.rfind(' ');
        if (pos != string::npos) {
            cout << str.size() - pos - 1 << endl;
        }
        else {
            cout << str.size() << endl;
        }
    }

}

class Solution {
public:
    bool isPalindrome(string s) {
        string str;
        for (char ch : s) {
            if (isalnum(ch)) {
                str += tolower(ch);
            }
        }
        string str_rev(str.rbegin(), str.rend());
        return str == str_rev;
    }
};